<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        //在控制台上打印一个九九乘法表
        var str = "" 
        for (var i = 1; i <= 9; i++) {
            for (var j = 1; j <= i; j++) {
                // document.write(i + "*" + j + "=" + j*i+" ")
                str = str + (i + "*" + j + "=" + j*i+" ")
            }
            // document.write("<br>")/* \n */
            str += "\n" //\n在控制台中上面表示换行
        }
        console.log(str);
    </script>
</body>

</html>